﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Vit.Web.Mvc.Results
{
    public class UnauthorizedResult : ViewResult
    {
        public UnauthorizedResult()
        {
        }

        public override void ExecuteResult(ControllerContext context)
        {
            ViewName = "Unauthorized";

            ViewData = context.Controller.ViewData;
            TempData = context.Controller.TempData;

            base.ExecuteResult(context);

            context.HttpContext.Response.StatusDescription = "Forbidden";
            context.HttpContext.Response.StatusCode = 403;
        }
    }
}
